fix(install): set user PATH automatically instead of printing the command#1
Merged
MasonStation merged 1 commit intomainfrom Apr 26, 2026
Merged
fix(install): set user PATH automatically instead of printing the command#1MasonStation merged 1 commit intomainfrom
MasonStation merged 1 commit intomainfrom
Conversation
…mand
Both installers detected when their target bin dir wasn't on PATH and asked
the user to copy/paste a long shell incantation themselves. Now they do it.
- install.ps1: writes the User-scope PATH via SetEnvironmentVariable and
injects into $env:Path so the current session sees `stack` immediately.
- install.sh: new add_to_user_path helper appends an idempotent export
(or fish set -gx) block to the right rc file (zsh/bash/fish) with a
marker comment so re-runs are no-ops.
- Site mirror at packages/site/public/install.{sh,ps1} synced.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
install.shandinstall.ps1previously detected when their target bin dir wasn't on PATH and asked the user to copy/paste a long shell incantation themselves. Now the installers do it.install.ps1writes User-scope PATH via[Environment]::SetEnvironmentVariable(..., 'User')and also injects into$env:Pathso the current PowerShell session can runstackimmediately.install.shadds anadd_to_user_pathhelper that detects bash/zsh/fish from$SHELLand appends an idempotentexport(orset -gx) block to the right rc file with a# ashlr-stack PATHmarker so re-runs are no-ops.packages/site/public/install.{sh,ps1}is byte-synced toscripts/.Why
A real user (me, on a fresh Windows 11 machine) ran
irm https://stack.ashlr.ai/install.ps1 | iexand hit:That's the opposite of what a one-liner installer should do. We already know the exact command — just run it.
Follow-up not in this PR
scripts/install.{sh,ps1}andpackages/site/public/install.{sh,ps1}are still maintained as duplicate copies. Should be wired up via aprebuildscript inpackages/site(or symlinks) so they can't drift.Test plan
irm https://stack.ashlr.ai/install.ps1 | iexand confirmstack --helpworks in a new PowerShell window without manual PATH editscurl -fsSL stack.ashlr.ai/install.sh | bash, open a new shell, confirmstack --helpworksSHELL=/bin/zshandSHELL=/usr/bin/fishto confirm correct rc file detection🤖 Generated with Claude Code